import type { RouteRecordRaw } from "vue-router";

export const myRoutes: Array<RouteRecordRaw> = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    //路径选择
    path: "/home",
    //路径名称
    name: "home",
    //组件导入
    component: () => import("../view/home/index.vue"),
    meta: {
      title: "主页",
      isShowTab: true,
    },
  },
  {
    path: "/center",
    name: "center",
    meta: {
      title: "个人中心",
      isShowTab: true,
    },
    component: () =>
      import(/* webpackChunkName: "login" */ "../view/center/index.vue"),
  },
  {
    path: "/sort",
    name: "sort",
    meta: {
      title: "分类",
      isShowTab: true,
    },
    component: () => import("../view/sort/index.vue"),
  },
  {
    path: "/shopCart",
    name: "shopCart",
    meta: {
      title: "购物车",
      isShowTab: true,
    },
    component: ()=> import("../view/shopCart/index.vue")
  },
  {
    path: "/pay",
    name: "Pay",
    meta: {
      title: "支付",
      isShowTab: false,
    },
    component: () => import("../view/pay/index.vue"),
  },
  {
    path: "/recommend",
    name: "recommend",
    meta: {
      title: "值的购买",
      isShowTab: true,
    },
    component: () => import("../view/recommend/index.vue"),
  },
  {
    path: "/login",
    name: "login",
    meta: {
      title: "登录",
      isShowTab: false,
    },
    component: () =>
      import(/* webpackChunkName: "login" */ "../view/login/index.vue"),
  },
  {
    path: "/search",
    name: "search",
    meta: {
      title: "搜索",
      isShowTab: true,
    },
    component: () => import("../view/search/index.vue"),
    children: [
      {
        path: "search/component",
        name: "searchDetail",
        meta: {
          title: "搜索",
          isShowTab: true,
        },
        component: () => import("../view/search/component/SearchDetail.vue"),
      },
    ],
  },
];
